from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, BooleanField, PasswordField
from wtforms.validators import DataRequired, Length


class LoginForm(FlaskForm):
    username = StringField('Username', validators=[DataRequired(), Length(1, 20)])
    password = PasswordField('Password', validators=[DataRequired(), Length(1, 128)])
    remember_me = BooleanField('Remember me')
    submit = SubmitField('Log in')


class CategorysForm(FlaskForm):
    name = StringField('名称', validators=[DataRequired(), Length(1, 128)])
    sort = StringField('排序', validators=[DataRequired()])
    submit = SubmitField('提交')
